package com.aurora.model.vo.rabbitMQ;

import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;

import static com.aurora.constant.MQPrefixConst.FIRST_QUEUE;
/**
 * @author liu jun
 */

@Data
public class SimpleSender {
    private static final Logger LOGGER = LoggerFactory.getLogger(SimpleSender.class);

    @Autowired
    private RabbitTemplate template;


    public void send(String message) {
        this.template.convertAndSend(FIRST_QUEUE, message);
        LOGGER.info(" [x] Sent '{}'", message);
    }

}
